package codeine;

import java.util.List;

import codeine.jsons.global.GlobalConfigurationJson;
import codeine.servlets.CodeineDirectoryServletModule;

import com.google.common.collect.Lists;
import com.google.inject.Module;

public class CodeineDirectoryBootstrap extends AbstractCodeineBootstrap
{
	
	public static void main(String[] args)
	{
		boot(Component.DIRECTORY, CodeineDirectoryBootstrap.class);
	}

	@Override
	protected List<Module> getGuiceModules() {
		return Lists.<Module>newArrayList(new CodeineDirectoryModule(), new CodeineDirectoryServletModule());
	}

	@Override
	protected void execute() throws Exception {
//		new PeriodicExecuter(OldPeersRemove.INTERVAL, injector().getInstance(OldPeersRemove.class)).run();
	}

	@Override
	public int getHttpPort() {
		return injector().getInstance(GlobalConfigurationJson.class).directory_port();
	}
	
}
